package com.jianneng.jdg.model.homeactivity;

import com.example.com.jianneng.jdg.R;
import com.example.com.jianneng.jdg.R.id;
import com.example.com.jianneng.jdg.R.layout;
import com.example.com.jianneng.jdg.R.menu;
import com.jianneng.jdg.model.adapter.ReportMoneyDetailAdapter;
import com.jianneng.jdg.model.gallery.MyWorkerService;

import android.support.v7.app.ActionBarActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class ReportMoneyDetailActivity extends BaseActivity implements OnClickListener{
private LinearLayout mBack,mHistoryWages;
private ListView mReportDetailListView;
private ReportMoneyDetailAdapter mAdapter;
private FrameLayout mReportWages;
private View mHeadView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_report_money_detail);
		init();
		
		mAdapter = new ReportMoneyDetailAdapter(this, MyWorkerService.getReportMoney());
		mReportDetailListView.setAdapter(mAdapter);
	}
	private void init() {
		mBack = (LinearLayout) findViewById(R.id.report_money_back);
		mReportDetailListView = (ListView) findViewById(R.id.report_money_datail_ListView);
		mHistoryWages = (LinearLayout) findViewById(R.id.history_wages);
		mReportWages = (FrameLayout) findViewById(R.id.reprot_wages);
		mHeadView = LayoutInflater.from(this).inflate(R.layout.report_money_detail_head, null);            //异步解析xml中的布局
		mReportDetailListView.addHeaderView(mHeadView);
		mBack.setOnClickListener(this);
		mReportWages.setOnClickListener(this);
		mHistoryWages.setOnClickListener(this);
	}
	@Override
	public void onClick(View v) {
	switch ( v.getId()) {
	case R.id.report_money_back:
		finish();
		break;
	case R.id.reprot_wages :
		Toast.makeText(this, "上报工资", 1).show();
		
		break;
	case R.id.history_wages ://历史工资
		Intent intent = new Intent(this, HistoryWagesActivity.class);
		startActivity(intent);
		
		break;

	default:
		break;
	}
		
	}
	
}
